﻿<%@ Page Language="C#" Theme="Samples" AutoEventWireup="true" CodeFile="WebForm2.aspx.cs" Inherits="Samples_WebForm2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Prompt Sample 2</title>

<script type="text/javascript">
    function prompt1_ButtonSelect(sender, args)
    {
        var selectedButton = args.get_button();
        alert('You selected the "' + selectedButton.get_commandArgument() + '" button.');
    }
</script>

</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="sm1" runat="server" />
    <div>
        <h2>
            Using custom buttons within a prompt</h2>
        <div>
            <p>
                This sample demonstrates the ability to use custom button on a prompt and to capture
                which button was pressed.
            </p>
        </div>
        <div>
            <asp:Label ID="lblMessage" ForeColor="Red" runat="server" /></div>
        <div>
            <asp:Button ID="button1" Text="Show the prompt" runat="server" /></div>
            
<ae:Prompt ID="prompt1" Title="Prompt Sample 2" Message="I am prompt sample 2." ButtonOptions="Custom" OnCommand="prompt1_Command" runat="server">
    <ClientEvents>
        <ButtonSelect EventHandler="prompt1_ButtonSelect" />
    </ClientEvents>
    <Triggers>
        <ae:ControlPromptTrigger ControlID="button1" EventName="click" PreventDefault="true" />
    </Triggers>
    <Buttons>
        <ae:PromptButton ID="yesButton" CommandArgument="Yes" Text="Yes" AutoPostBack="true"
            runat="server" />
        <ae:PromptButton ID="noButton" CommandArgument="No" Text="No" runat="server" />
        <ae:PromptButton ID="cancelButton" CommandArgument="Cancel" Text="Cancel" runat="server" />
    </Buttons>
</ae:Prompt>
        
    </div>
    </form>
</body>
</html>
